package me.ratel.demo.eBook.domain.model.user;

import me.ratel.demo.eBook.domain.model.ModelConstants;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * @author ${user}
 * @time 2016/6/12 22:25
 */
@Entity
@Table(name = "t_user")
public class User implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;

    @Column(nullable = false)
    private String name;

    @Column(nullable = false)
    private String openId;

    @Column(nullable = false)
    private Integer deleteFlag = ModelConstants.DeleteFlag.NO.getValue();

    @Column(nullable = false)
    private Date addTime = new Date();

    @Column(nullable = false)
    private Date updateTime = new Date();

    public User() {
    }

    public User(String name, String openId) {
        this.name = name;
        this.openId = openId;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }
}
